﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MCPlatform.Shared.Contracts;
using ILogger = MCPlatform.Shared.Contracts.ILogger;

namespace MCPlatform.Shared.Components
{
    public class NLogger :ILogger
    {
        #region Fields
        NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
        #endregion

        #region Properties

        #endregion

        #region Methods

        public void Error( string message)
        {

            logger?.Error(message);
        }
        public void Error(Exception exception, string messageTemplate)
        {

            logger?.Error(exception, messageTemplate);
        }

        public void Error(Exception exception, string messageTemplate, params object[] args)
        {
            
            logger?.Error(exception, messageTemplate, args);
        }

        public void Info(string message)
        {
            
            logger?.Info(message);
        }

        public void Info(string messageTemplate, params object[] args)
        {
           
            logger?.Info(messageTemplate, args);
        }

        public void Warn(string message)
        {
           
            logger?.Warn(message);
        }

        public void Warn(Exception exception, string messageTemplate, params object[] args)
        {

            logger?.Warn(exception, messageTemplate, args);
        }

        public void Warn(string messageTemplate, params object[] args)
        {

            logger?.Warn(messageTemplate, args);
        }

        public void Debug(string message)
        {

            logger?.Debug(message);
        }

        public void Debug(string messageTemplate, params object[] args)
        {

            logger?.Debug(messageTemplate, args);
        }

        #endregion

        #region Function
        //private void InitializeLogger()
        //{
        //    if (_logger == null)
        //    {
        //        var logFilePath = Environments.LogFilePath;

        //        _logger = new LoggerConfiguration()
        //            .WriteTo.File(logFilePath, rollingInterval: RollingInterval.Day, retainedFileCountLimit: 30)
        //            .CreateLogger();
        //    }
        //}
        #endregion
    }
}
